import 'package:sports_new/entity/ai/chart_match_entity.dart';

class ChartLineEntity{
  int? guestId;
  String? guestLogo;
  String? guestName;
  String? guestScore;
  String? guestScoreHalf;
  String? guestScoreOt;
  int? homeId;
  String? homeLogo;
  String? homeName;
  String? homeScore;
  String? homeScoreHalf;
  String? homeScoreOt;
  int? hours;
  int? leagueId;
  String? leagueName;
  List<Values>? list;
  int? matchId;
  String? matchTime;
  double? max;
  double? min;
  String? s;
  String? p;
  String? f;
  int? status;
  List<String>? option;
  List<String>? tips;

  ChartLineEntity(
      {this.guestId,
        this.guestLogo,
        this.guestName,
        this.guestScore,
        this.guestScoreHalf,
        this.guestScoreOt,
        this.homeId,
        this.homeLogo,
        this.homeName,
        this.homeScore,
        this.homeScoreHalf,
        this.homeScoreOt,
        this.hours,
        this.leagueId,
        this.leagueName,
        this.list,
        this.matchId,
        this.matchTime,
        this.max,
        this.min,
        this.s,
        this.p,
        this.f,
        this.status,
        this.option,
        this.tips});

  ChartLineEntity.fromJson(Map<String, dynamic> json, {String? type}) {
    guestId = json['guestId'];
    guestLogo = json['guestLogo'];
    guestName = json['guestName'];
    guestScore = json['guestScore'];
    guestScoreHalf = json['guestScoreHalf'];
    guestScoreOt = json['guestScoreOt'];
    homeId = json['homeId'];
    homeLogo = json['homeLogo'];
    homeName = json['homeName'];
    homeScore = json['homeScore'];
    homeScoreHalf = json['homeScoreHalf'];
    homeScoreOt = json['homeScoreOt'];
    hours = json['hours'];
    leagueId = json['leagueId'];
    leagueName = json['leagueName'];
    if (json['list'] != null) {
      list = <Values>[];
      json['list'].forEach((v) {
        list!.add(new Values.fromJson(v));
      });
    }
    matchId = json['matchId'];
    matchTime = json['matchTime'];
    max = json['max'];
    min = json['min'];
    s = json['s'];
    p = json['p'];
    f = json['f'];
    status = json['status'];
    option = json['option']?.cast<String>();
    tips = json['tips']?.cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['guestId'] = this.guestId;
    data['guestLogo'] = this.guestLogo;
    data['guestName'] = this.guestName;
    data['guestScore'] = this.guestScore;
    data['guestScoreHalf'] = this.guestScoreHalf;
    data['guestScoreOt'] = this.guestScoreOt;
    data['homeId'] = this.homeId;
    data['homeLogo'] = this.homeLogo;
    data['homeName'] = this.homeName;
    data['homeScore'] = this.homeScore;
    data['homeScoreHalf'] = this.homeScoreHalf;
    data['homeScoreOt'] = this.homeScoreOt;
    data['hours'] = this.hours;
    data['leagueId'] = this.leagueId;
    data['leagueName'] = this.leagueName;
    if (this.list != null) {
      data['list'] = this.list!.map((v) => v.toJson()).toList();
    }
    data['matchId'] = this.matchId;
    data['matchTime'] = this.matchTime;
    data['max'] = this.max;
    data['min'] = this.min;
    data['s'] = this.s;
    data['p'] = this.p;
    data['f'] = this.f;
    data['status'] = this.status;
    data['option'] = this.option;
    data['tips'] = this.tips;
    return data;
  }
}

class Values {
  double? p;
  double? s;
  double? f;
  double? line;
  int? i;

  Values({this.p, this.s, this.f, this.i});

  Values.fromJson(Map<String, dynamic> json) {
    p = json['p'];
    s = json['s'];
    f = json['f'];
    line = json['line'];
    i = json['i'];
  }

  Map<String, dynamic> toJson({String? type}) {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['p'] = this.p;
    data['s'] = this.s;
    data['f'] = this.f;
    data['line'] = this.line;
    data['i'] = this.i;
    return data;
  }
}